import { useUserStoreHook } from '@/store/modules/user'

export const checkPermission = permissionRoles => {
  if (Array.isArray(permissionRoles) && permissionRoles.length > 0) {
    const { roles } = useUserStoreHook()
    return roles.some(role => permissionRoles.includes(role))
  } else {
    console.error('need roles!')
    return false
  }
}
